package com.itheima.controller;


import com.itheima.entity.Count;
import com.itheima.entity.CountClazzList;
import com.itheima.entity.CountJobList;
import com.itheima.entity.Result;
import com.itheima.service.CountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("report")
public class CountCtroller {

    @Autowired
    private CountService countService;

    @GetMapping("empGenderData")
    public Result getEmpGenderData(){

        List<Count> empGenderData =  countService.getEmpGenderData();

        return Result.success(empGenderData);
    }

    @GetMapping("/empJobData")
    public Result getEmpJobData(){

        CountJobList countJobList =  countService.getEmpJobData();

        return Result.success(countJobList);
    }

    @GetMapping("studentDegreeData")
    public Result getStudentDegreeData(){

        List<Count> studentDegreeData =  countService.getStudentDegreeData();

        return Result.success(studentDegreeData);
    }

    @GetMapping("/studentCountData")
    public Result getStudentClazzData(){

        CountClazzList countClazzList =  countService.getStudentClazzData();

        return Result.success(countClazzList);
    }
}
